package com.xuelang.pipeline.app.resource;

import com.xuelang.pipeline.client.common.request.PageParam;
import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.resource.dto.EnvironmentDTO;
import com.xuelang.pipeline.client.resource.dto.EnvironmentQuery;

import java.util.List;

/**
 * 环境服务接口
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
public interface EnvironmentService {
    /**
     * 查询环境列表(有过滤条件)
     *
     * @param dtoPageParam
     * @return
     */
    PageRecord<EnvironmentDTO> pageList(PageParam<EnvironmentQuery> dtoPageParam);

    /**
     * 查询环境列表(有过滤条件)
     *
     * @param environmentQuery
     * @return
     */
    List<EnvironmentDTO> list(EnvironmentQuery environmentQuery);

    /**
     * 添加环境
     *
     * @param environmentDTO
     * @return
     */
    Boolean add(EnvironmentDTO environmentDTO);

    /**
     * 更新环境
     *
     * @param environmentDTO
     * @return
     */
    Boolean update(EnvironmentDTO environmentDTO);

    /**
     * 删除环境
     *
     * @param uuid
     * @return
     */
    Boolean delete(String uuid);
    /**
     * 查询环境
     *
     * @param uuid
     * @return
     */
    EnvironmentDTO query(String uuid);
    /**
     * 该环境是否存在关联流水线
     *
     * @param environmentUuid
     * @return
     */
    Boolean existsPipelineByEnvironment(String environmentUuid);
}
